package com.isoft.c2team3service2.controller;

import com.isoft.c2team3service2.service.MountingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 蓝莓
 * @date 2025/9/10 10:23
 */
@RestController
@RequestMapping("/mounting")
public class MountingController {

//    前端需要实时或定时刷新用户访问动态，通常有两种方式：
//    主动查询：页面加载时或定时（如每 30 秒）调用后端接口，获取用户最后访问时间

    @Autowired
    private MountingService mountingService;
    // 获取艺人访问的之前访问时间,返回对应的分钟
    @GetMapping("/viewed")
    public long mounting(String name) {
        return mountingService.mounting(name);
    }
}
